package simplescenegraph.math;

public class Color3f {

	public static final Color3f white = new Color3f(1, 1, 1);
	
	public static final Color3f red = new Color3f(1, 0, 0);
	
	public static final Color3f green = new Color3f(0, 1, 0);
	
	public static final Color3f blue = new Color3f(0, 0, 1);
	
	public static final Color3f black = new Color3f(0, 0, 0);
	
	private float r;
	
	private float g;
	
	private float b;
	
	private float[] rgb = null; 
	
	public Color3f() {
		r = 0; g = 0; b = 0;
	}
	
	public Color3f(float r, float g, float b) {
		this.r = r; this.g = g; this.b = b;
	}
	
	public Color3f(Color3f c0) {
		r = c0.r; g = c0.g; b = c0.b;
	}
	
	public float[] toFloatArray() {
		if (rgb == null) rgb = new float[3];
		rgb[0] = r; rgb[1] = g; rgb[2] = b;
		return rgb;
	}

	public float getRed() {
		return r;
	}

	public void setRed(float r) {
		this.r = r;
	}

	public float getGreen() {
		return g;
	}

	public void setGreen(float g) {
		this.g = g;
	}

	public float getBlue() {
		return b;
	}

	public void setBlue(float b) {
		this.b = b;
	}
	
}
